<template>
  <div>
    {{user.name}}/{{user.age}}
    <div v-html="html"></div>
    <wxParse :content="html2" />
  </div>

</template>

<script>

import wxParse from 'mpvue-wxparse'

export default {
  data () {
    return {
      user: {},
      html: '<h2>中国人</h2><img src="/static/images/cjy2.jpg" />',
      html2: '<h2>中国人</h2><img src="https://www.jb51.net/images/logo.gif" /><ul><li>aaa</li><b>abc</b>'
    }
  },
  components: {
    wxParse
  },
  created () {
    console.log('created')
  },
  onLoad (options) {
    console.log(options)
    let that = this
    wx.request({
      url: 'https://www.easy-mock.com/mock/5c83d42e6ed1b709ab872b59/ugwxcloud/user',
      // url: 'https://www.easy-mock.com/mock/5c83d42e6ed1b709ab872b59/ugwxcloud/users',
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        console.log(res.data)
        that.user = res.data.data
      }
    })
  }
}
</script>

<style scoped>
  @import url("~mpvue-wxparse/src/wxParse.css");
</style>